import com.sun.xml.internal.ws.api.ha.StickyFeature;

import java.util.*;

public class Test {

    public static void func(String str1, String str2) {
        Set<Character> set1 = new HashSet<>();
        for (int i = 0; i < str2.length(); i++) {
            str2 = str2.toUpperCase();
            char ch1 = str2.charAt(i);
            set1.add(ch1);
        }
        Set<Character> set2 = new HashSet<>();
        for (int i = 0; i < str1.length(); i++) {
            str1 = str1.toUpperCase();
            char ch2 = str1.charAt(i);
            if (!set1.contains(ch2) && !set2.contains(ch2)) {
                set2.add(ch2);
                System.out.print(ch2+" ");
            }
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String str1 = scanner.nextLine();
            String str2 = scanner.nextLine();
            func(str1,str2);
        }
    }

}
